import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: "index",
    redirect: '/goods',
    meta: {
      title: "首页",
    },
    children: [
      {
        path: '/goods',
        name: "goods",
        component: () => import('@/view/goods.vue'),
        meta: {
          title: "商品首页",
        }
      },
      {
        path: '/detail',
        name: "detail",
        component: () => import('@/view/detail.vue'),
        meta: {
          title: "商品详情",
        }
      },
      {
        path: '/order',
        name: "order",
        component: () => import('@/view/order.vue'),
        meta: {
          title: "订单详情",
        }
      },
    ]
  }
  
]

const router = createRouter({
  history: createWebHistory(),
  routes
})
export default router
